package routes

import (
	"gitee.com/song-yao-shun/MQH/controller"
	"gitee.com/song-yao-shun/MQH/middleware"
	"github.com/gin-gonic/gin"
)

func CategoryRoutes(r *gin.Engine){
	categoryController := controller.NewCategoryController()

	category := r.Group("api/categories",middleware.AuthMiddleware())
	{
		category.POST("",categoryController.Create)
		category.PUT("/:id",categoryController.Update)
		category.GET("/:id",categoryController.Show)
		category.DELETE("/:id",categoryController.Delete)
		category.POST("/getall",categoryController.List)
	}
}
